﻿using System;
using System.Collections.Generic;
using System.Linq;
using System.Text;
using System.Threading.Tasks;

namespace ChainOfResp
{
    public class Client
    {

        private LogHandler _chainOfResponsibility;
        public void LoadHandlers()
        {
            var startedHandler = new TStartedHandler();
            var errorHandler = new TErrorHandler();
            var finishedHandler = new TFinishedHandler();

            startedHandler.SetSuccessor(errorHandler);
            errorHandler.SetSuccessor(finishedHandler);

            _chainOfResponsibility = startedHandler;

        }

        public void Request(string log)
        {
            var status = _chainOfResponsibility.HandleRequest(log);
            if (status != TaskStatus.None)
            {
                SendMessageToSystem(status);
            }
        }


        private void SendMessageToSystem(TaskStatus status)
        {
            throw new NotImplementedException();
        }

    }
}
